package com.example.android.chartapplication.Fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.android.chartapplication.ChartRect;
import com.example.android.chartapplication.R;

import java.util.Random;

public class ChartRectFragment extends Fragment {

    ChartRect chartRect;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_chart_rect, container, false);
        chartRect = view.findViewById(R.id.chartRect);
        return view;
    }

    @Override
    public void onStart() {
        super.onStart();

        Random random = new Random();
        for (int i = 0; i < 30; i++) {
            chartRect.addData(random.nextInt(100));
        }
    }
}
